﻿USE [GestionePolveri]
GO

/****** Object:  Table [GP].[LottiNC]    Script Date: 09/04/2013 15:43:34 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [GP].[LottiNC](
	[IDLotto] [bigint] NOT NULL,
	[IDOperatore] [uniqueidentifier] NOT NULL,
	[FlagNC] [bit] NOT NULL,
	[FlagBlocco] [bit] NOT NULL,
	[Note] [varchar](max) NULL,
 CONSTRAINT [PK_LottiNC] PRIMARY KEY CLUSTERED 
(
	[IDLotto] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [GP].[LottiNC]  WITH CHECK ADD  CONSTRAINT [FK_LottiNC_aspnet_Users] FOREIGN KEY([IDOperatore])
REFERENCES [dbo].[aspnet_Users] ([UserId])
GO

ALTER TABLE [GP].[LottiNC] CHECK CONSTRAINT [FK_LottiNC_aspnet_Users]
GO

ALTER TABLE [GP].[LottiNC]  WITH CHECK ADD  CONSTRAINT [FK_LottiNC_Lotti] FOREIGN KEY([IDLotto])
REFERENCES [GP].[Lotti] ([IDLotto])
GO

ALTER TABLE [GP].[LottiNC] CHECK CONSTRAINT [FK_LottiNC_Lotti]
GO

